package com.sinosoft.web;

import com.sinosoft.domain.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author loujiang
 * @date 2020/12/20 3:50 下午
 * @NOTE:
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/getAll")
    public List<User> getUsers() {
        List<User> users = new ArrayList<>();
        User sam = new User();
        sam.setId(1);
        sam.setName("sam");
        users.add(sam);
        return users;
    }

    @RequestMapping("/getUser")
    public User getUser(String name) {
        System.out.println("geUser:"+name);
        User sam = new User();
        sam.setId(1);
        sam.setName(name);
        return sam;
    }

}
